package com.ygqh.baby.mapper;

import com.ygqh.baby.ao.PromotionType;
import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.ao.SalesPlatform;
import com.ygqh.baby.model.YgProduct4ListModel;
import com.ygqh.baby.po.YgProductSecond;
import com.ygqh.baby.po.YgProductSecondExample;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface YgProductSecondMapper {
    int countByExample(YgProductSecondExample example);

    int deleteByExample(YgProductSecondExample example);

    int deleteByPrimaryKey(Long id);

    int insert(YgProductSecond record);

    int insertSelective(YgProductSecond record);

    List<YgProductSecond> selectByExample(YgProductSecondExample example);

    YgProductSecond selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") YgProductSecond record, @Param("example") YgProductSecondExample example);

    int updateByExample(@Param("record") YgProductSecond record, @Param("example") YgProductSecondExample example);

    int updateByPrimaryKeySelective(YgProductSecond record);

    int updateByPrimaryKey(YgProductSecond record);

    int countSuper(@Param("supplierId") Long supplierId, @Param("pStatus") String pStatus,
                   @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("q") String q);

    List<YgProductSecond> selectSuper(@Param("queryInfo") QueryInfo queryInfo, @Param("supplierId") Long supplierId, @Param("pStatus") String pStatus,
                                      @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("q") String q);

    List<YgProductSecond> selectProductSecondByProductId(@Param("productId") Long productId, @Param("pType") PromotionType pType,
                                                         @Param("currentDate") String currentDate);

    List<YgProduct4ListModel> selectProductBySecondId(@Param("queryInfo") QueryInfo queryInfo, @Param("secondId") Long secondId,
                                                      @Param("productName") String productName, @Param("groupId") Long groupId);

    YgProductSecond selectActive(@Param("salesPlatform") SalesPlatform salesPlatform);

    List<YgProductSecond> selectSecondByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
                                             @Param("secondId") Long secondId);

    List<YgProduct4ListModel> selectProductBySpecifyDate(@Param("startTime") Date startTime,
                                                         @Param("endTime") Date endTime,
                                                         @Param("salesPlatform") SalesPlatform salesPlatform);

    YgProductSecond selectByProductIdAndStartTime(@Param("productId") Long productId, @Param("startTime") Date startTime);

    YgProductSecond selectUnEndByPid(@Param("productId") Long productId, @Param("endTime") Date endTime);

	YgProductSecond selectActiveWithProductInfo(@Param("salesPlatform") SalesPlatform salesPlatform);

    YgProductSecond selectWithProductInfoById(@Param("id") Long id);
}
